package com.realone.packman.codec.vo;

import java.util.ArrayList;
import java.util.List;

/**
 * 电池
 * @author hugx
 * @create 2018-09-12 16:02
 */
public class Cell {
    private List<Double> voltageList ;// 电池电压
    private double cellPackVoltage;//电池包电压
    private int rechargeState; //电池包充放电状态和电流
    private double electricitySize; //电流大小
    private List<CellChargeState> cellChargeStateList;  //电池充电状态集合
    private int capacity; //电池包容量百分比
    private CellTemperature cellTemperature; // 电池包温度
    private int humidity; //电池仓湿度值，0-100%RH
    private char  temperature; //电池仓温度值（范围-127-127 ℃）

    /**
     * 获取电池电压集合
     * @return
     */
    public List<Double> getVoltageList() {
        return voltageList;
    }

    public void setVoltageList(List<Double> voltageList) {
        this.voltageList = voltageList;
    }

    /**
     * 添加电池电压
     * @param voltage
     */
    public void addVoltage(Double voltage){
        if(voltage == null){
            return ;
        }

        if(voltageList == null){
            voltageList=new ArrayList<Double>(1);
        }

        voltageList.add(voltage);
    }

    /**
     * 获取指定组的电池电压
     * @param index
     * @return
     */
    public Double getVoltage(int index){
        if(voltageList == null){
            return null;
        }

        return voltageList.get(index);
    }

    /**
     * 获取电池包电压
     * @return
     */
    public double getCellPackVoltage() {
        return cellPackVoltage;
    }

    /**
     * 设置电池包电压
     * @param cellPackVoltage
     */
    public void setCellPackVoltage(double cellPackVoltage) {
        this.cellPackVoltage = cellPackVoltage;
    }



    /**
     * 电池包充放电状态和电流
     * @return 0: 静态； 1: 充电
     */
    public int getRechargeState() {
        return rechargeState;
    }

    /**
     * 电池包充放电状态和电流
     * @param rechargeState  0: 静态； 1: 充电
     */
    public void setRechargeState(int rechargeState) {
        this.rechargeState = rechargeState;
    }

    /**
     * 电流大小
     * @return
     */
    public double getElectricitySize() {
        return electricitySize;
    }

    /**
     * 电流大小
     * @param electricitySize
     */
    public void setElectricitySize(double electricitySize) {
        this.electricitySize = electricitySize;
    }

    /**
     * 获取电池充电状态集合
     * @return
     */
    public List<CellChargeState> getCellChargeStateList() {
        return cellChargeStateList;
    }

    /**
     * 设置电池充电状态集合
     * @param cellChargeStateList
     */
    public void setCellChargeStateList(List<CellChargeState> cellChargeStateList) {
        this.cellChargeStateList = cellChargeStateList;
    }

    /**
     * 添加电池充电状态到 电池充电状态集合中
     * @param cellChargeState
     */
    public void addCellChargeState(CellChargeState cellChargeState){
        if(cellChargeState == null){
            return ;
        }

        if(cellChargeStateList == null){
            cellChargeStateList=new ArrayList<CellChargeState>(1);
        }

        cellChargeStateList.add(cellChargeState);
    }

    /**
     * 电池包容量百分比
     * @return
     */
    public int getCapacity() {
        return capacity;
    }

    /**
     * 电池包容量百分比
     * @param capacity
     */
    public void setCapacity(int capacity) {
        this.capacity = capacity;
    }

    /**
     * 电池包温度
     * @return
     */
    public CellTemperature getCellTemperature() {
        return cellTemperature;
    }

    /**
     * 电池包温度
     * @param cellTemperature
     */
    public void setCellTemperature(CellTemperature cellTemperature) {
        this.cellTemperature = cellTemperature;
    }

    /**
     * 电池仓湿度值，0-100%RH
     * @return
     */
    public int getHumidity() {
        return humidity;
    }

    /**
     * 电池仓湿度值，0-100%RH
     * @param humidity
     */
    public void setHumidity(int humidity) {
        this.humidity = humidity;
    }

    /**
     * 电池仓温度值（范围-127-127 ℃）
     * @return
     */
    public char getTemperature() {
        return temperature;
    }

    /**
     * 电池仓温度值（范围-127-127 ℃）
     * @param temperature
     */
    public void setTemperature(char temperature) {
        this.temperature = temperature;
    }
}
